<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=1024, user-scalable=no">

  <title>The Boson framework</title>

  <!-- Required stylesheet -->
  <link rel="stylesheet" media="all" href="core/deck.core.css">

  <!-- Extension CSS files go here. Remove or add as needed. -->
  <link rel="stylesheet" media="all" href="extensions/goto/deck.goto.css">
  <link rel="stylesheet" media="all" href="extensions/menu/deck.menu.css">
  <link rel="stylesheet" media="all" href="extensions/navigation/deck.navigation.css">
  <link rel="stylesheet" media="all" href="extensions/status/deck.status.css">
  <link rel="stylesheet" media="all" href="extensions/scale/deck.scale.css">

  <!-- Style theme. More available in /themes/style/ or create your own. -->
  <link rel="stylesheet" media="all" href="themes/style/jb.css">

  <!-- Transition theme. More available in /themes/transition/ or create your own. -->
  <link rel="stylesheet" media="all" href="themes/transition/horizontal-slide.css">

  <!-- Basic black and white print styles -->
  <!--<link rel="stylesheet" media="print" href="core/print.css">-->

  <!-- Required Modernizr file -->
  <script src="modernizr.custom.js"></script>
</head>
<body>
  <div class="deck-container">

    <!-- Begin slides. Just make elements with a class of slide. -->

    <section class="slide" id="frontpage">
      <div class="vcenter">
        <h1>The low-level awesomeness of Go</h1>
        <h2>Seen by a C++ developer</h2>
      </div>
    </section>

    <section class="slide" id="cpp-concurrent">
      <div class="vcenter">
        <h1>Concurrent I/O programming in C++</h1>
        <ul>
          <li class="slide" id="cpp-conc-complicated" style:"font-size:0.6em;">
            <strong>Complicated</strong>: Program intent diluted into synchronization tooling (threads, mutexes, event loops).
          </li>

          <li class="slide" id="cpp-con-verbose" style:"font-size:0.6em;">
            <strong>Verbose</strong>:  A lot of code to write to do simple things.
          </li>

          <li class="slide" id="cpp-conc-error" style:"font-size:0.6em;">
            <strong>Delicate</strong>: One step out of the way and you blow the whole thing up.
          </li>
        </ul>
      </div>
    </section>

    <section class="slide" id="go-awesomeness">
      <div class="vcenter">
        <h1>Why Go appeals  C++ developers</h1>
        <ul>
          <li class="slide" id="go-clean">
            <strong>Goroutines</strong>: Break the code into logical parts
          </li>

          <li class="slide" id="go-io-friendly">
            <strong>I/O friendly</strong>: Netpoller frees the developer from infamous callbacks
          </li>

          <li class="slide" id="go-cpu-time">
            <strong>Code as data flow</strong>: Channels makes it easy to write application as a data pipeline
          </li>
        </ul>
      </div>
    </section>
    
    <section class="slide" id="goroutines">
      <div class="vcenter">
        <h2>Goroutines : how does it do it</h2>
      </div>
    </section>

    <section class="slide" id="goroutines1">
      <div class="vcenter">
        <h2>Goroutines : how does it do it</h2>
        <h1>ASM code</h1>
            <p>Go is written in <strong>assembly</strong> and <strong>Go</strong> exclusively (except for cgo).</p>
      </div>
    </section>

    <section class="slide" id="goroutines2">
      <div class="vcenter">
        <h2>Goroutines : how does it do it</h2>
        <h1>Fast context switching</h1>
        <p>Jumping the execution flow between a <strong>goroutine</strong> and the <strong>scheduler</strong> is fast</p>
      </div>
    </section>

    <section class="slide" id="goroutines3">
      <div class="vcenter">
        <h2>Goroutines : how does it do it</h2>
        <h1>Fast context switching</h1>
        <div class="measurepanel">
          <div style="width:60%;height:100px;" class="measure">Process/Thread</div><div class="mvalue"> 3000 to 4500 ns</div>
          <div style="width:25%;height:100px;font-size:0.7em;" class="measure">CPU Affinity</div><div class="mvalue">1300 to 1900 ns</div>
          <div style="width:0.15%;height:100px;" class="measure">CPU Affinity</div><div class="mvalue">Goroutine: &lt; 10 ns</div>
        </div>
      </div>
    </section>

    <section class="slide" id="tls1">
      <div class="vcenter">
        <h2>Goroutines : how does it do it</h2>
        <h1>Thread Local Storage</h1>
        <p><strong>TLS</strong> is used to jump from a Goroutine to the scheduler</p>
        <p>Classic <strong>TLS</strong> can be costly depending on the platform</p>
      </div>
    </section>

    <section class="slide" id="tls2">
      <div class="vcenter">
        <h2>Goroutines : how does it do it</h2>
        <h1>Thread Local Storage</h1>
        <p>Go takes advantage of a unused <strong>MMU registry</strong> if possible</p>
      </div>
    </section>

    <section class="slide" id="np">
      <div class="vcenter">
        <h2>Netpoller: how does it do it</h2>
      </div>
    </section>

    <section class="slide" id="np1">
      <div class="vcenter">
        <h2>Netpoller: how does it do it</h2>
        <h1>Hidden in the scheduler</h1>
        <p>The <strong>scheduler</strong> unparks <strong>Goroutines</strong> just when <strong>I/O is available.</strong></p>
      </div>
    </section>

    <section class="slide" id="np1">
      <div class="vcenter">
        <h2>Netpoller: how does it do it</h2>
        <h1>Syscalls depending on the OS</h1>
        <p><code>epoll</code> for <strong>Linux</strong></p>
        <p><code>kqueue</code> for <strong>Mac OS</strong></p>
        <p><code>I/O Completion ports</code> for <strong>Windows</strong></p>
      </div>
    </section>

    <section class="slide" id="go-channels">
      <div class="vcenter">
        <h2>Channels : how does it do it</h2>
      </div>
    </section>

    <section class="slide" id="go-channels-1">
      <div class="vcenter">
        <h2>Channels : how does it do it</h2>
        <h1>Limited usage of mutexes</h1>
        <p><strong>Lock-free</strong> for a <strong>writer</strong> in a <strong>non-full</strong> channel.</p>
        <p><strong>Lock-free</strong> for a <strong>reader</strong> in a <strong>non-empty</strong> channel.</p>
        <p><strong>Critical section</strong> stays <strong>short</strong> for blocking calls.</p>
      </div>
    </section>

    <section class="slide" id="go-channels-2">
      <div class="vcenter">
        <h2>Channels : how does it do it</h2>
        <h1>Atomics</h1>
        <p>Lock-free operations use atomic <strong>CopyAndSwap</strong> for modern processors</p>
      </div>
    </section>

    <section class="slide" id="go-channels-3">
      <div class="vcenter">
        <h2>Channels : how does it do it</h2>
        <h1>Fast mutexes</h1>
        <p><strong>Go mutexes</strong> are implemented with <strong>futexes</strong> (Fast Userspace muTEX).</p>
      </div>
    </section>

    <section class="slide" id="github">
      <div class="vcenter">
        <h1>See those things implemented in C++</h1>
        <h2><a href="https://duckie.github.io/boson/">duckie.github.io/boson</a></h2>
      </div>
    </section>

    <section class="slide" id="thanks">
      <h1>Thank you very much</h1>
    </section>


    <!-- deck.navigation snippet -->
    <!--<div aria-role="navigation">
      <a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
      <a href="#" class="deck-next-link" title="Next">&#8594;</a>
    </div>-->

    <!-- deck.status snippet -->
    <p class="deck-status" aria-role="status">
      <span class="deck-status-current"></span>
      /
      <span class="deck-status-total"></span>
    </p>

    <!-- deck.goto snippet -->
    <form action="." method="get" class="goto-form">
      <label for="goto-slide">Go to slide:</label>
      <input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
      <datalist id="goto-datalist"></datalist>
      <input type="submit" value="Go">
    </form>

    <!-- End extension snippets. -->
  </div>

<!-- Required JS files. -->
<script src="jquery.min.js"></script>
<script src="core/deck.core.js"></script>

<!-- Extension JS files. Add or remove as needed. -->
<script src="extensions/menu/deck.menu.js"></script>
<script src="extensions/goto/deck.goto.js"></script>
<script src="extensions/status/deck.status.js"></script>
<script src="extensions/navigation/deck.navigation.js"></script>
<script src="extensions/scale/deck.scale.js"></script>

<!-- Initialize the deck. You can put this in an external file if desired. -->
<script>
  $(function() {
    $.deck('.slide');
  });
</script>
</body>
</html>
